/**
 * 项目名：化工企业安全生产信息化管理平台
 * 日期：    2020-03-01 21:14:36
 * Copyright (c) 2015- -版权所有
 */

package com.joysuch.wwyt.edu.bean;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class EduDoExamResultBean implements java.io.Serializable {

    // columns START
    // ID
    @ApiModelProperty("examId")
    private Long id;
    // 参与对象
    private List<UserAnswer> answers;
    // 实际开考时间
    private Date actualStartTime;

    @ApiModelProperty("签名")
    private String autograph;
    // columns END
    // 前端是否主动提交，此字段用做后端定时检查考试时间到时是否提交过？ 0 未提交 1 前端已提交 3 系统提交
    private Integer isSubmit;

    private Long tenentId;

    private String orgCode;

    private ExamResult examResult;

    private Long resultByUserId;

    private Date releaseTime;
    @Data
    public static class UserAnswer {
        // EduTestPaperQuestion.id
        private Long id;
        // EduQuestion.id
        private Long qid;
        private String answer;
    }

    @Data
    public static class ExamUserAnswer {

        private Long id;

        private Double score;
    }



    @Data
    public static class ExamResult {
        // EduTestPaperQuestion.id
        // EduQuestion.id
        @ApiModelProperty("考试记录id")
        private Long examRecordId;
        @ApiModelProperty("得分")
        private String score;
        @ApiModelProperty("是否通过")
        private boolean passed;
        @ApiModelProperty("答对题数")
        private int rightCount;
        @ApiModelProperty("答错题数")
        private int wrongCount;
        @ApiModelProperty("是否可重考")
        private Boolean canTryAgain;
        @ApiModelProperty("是否阅卷 0 不需要阅卷  1 未阅卷 2 已阅卷")
        private Integer isCheck;

        public ExamResult(Long examRecordId, String score, boolean passed, int rightCount, int wrongCount, Boolean canTryAgain,Integer isCheck) {
            this.examRecordId = examRecordId;
            this.score = score;
            this.passed = passed;
            this.rightCount = rightCount;
            this.wrongCount = wrongCount;
            this.canTryAgain = canTryAgain;
            this.isCheck = isCheck;
        }

        public ExamResult(String score, boolean passed) {
            super();
            this.score = score;
            this.passed = passed;
        }

        public ExamResult() {
        }

    }

}
